Skip to main content

Webhooks

We recommend creating a manifest including a valid webhook URI as part of the shipping object. This enables real time updates of the shipment status.

  • The property webhookUri should be set on the shipping instance should you wish to use the webhook callbacks.
  • Webhooks are responded to using a POST request to the provided URL
  • Webhooks are triggered by any status update including those of individual shipments, i.e. when a specific delivery respective to a shipment has shipped.
  • Webhooks should accept the JSON content type application/json
  • Webhooks send a special x-webhook-shared-token header which is a secret token that can be set by the carrier and used for validation of the webhook
  • You should always respond to POST request with a 200 OK status header, the body maybe empty.
  • The body of the webhook contains valid JSON with the following parameters:
Webhook body
{
"id": "string",
"carrierTrackingNumber": "string",
"metaData": "string",
"status": "string",
"ts": "JSON Date",
"trackingUrl": "string",
"code": "number",
"failedStatus": "string",
"details": {
"lang": {
"en": {
"headline": "string",
"description": "string"
},
"nl": {
"headline": "string",
"description": "string"
}
},
"courierName": "string",
"reason": "string"
}
}
FieldTypeFormatDescription
idstringstringThe shipment ID
carrierTrackingNumberstringstringThe carrier tracking number
metaDatastringstringThe metadata
statusstringstringThe status of the shipment
tsJSON DateJSON DateThe timestamp of the shipment
trackingUrlstringstringThe tracking URL of the shipment
codenumbernumberThe code of the shipment
failedStatusstringstringThe failed status of the shipment
detailsobjectobjectThe details of the shipment status

An example of a webhook body:

Webhook body
{
"id": "fx6_ZSWp0RDc24csBqOj9",
"carrierTrackingNumber": "P199684830307745678",
"metaData": "78420240902-2",
"status": "FAILED_ATTEMPT",
"location": null,
"ts": "2024-09-02T13:08:06.574Z",
"trackingUrl": "https://t.pdlr.nl/P199684830307745678/",
"code": 601,
"failedStatus": "CUSTOMER_NOT_PRESENT_NO_NEIGHBOURS",
"details": {
"lang": {
"en": {
"headline": "Delivery attempt failed",
"description": "Delivery attempt failed at destination"
},
"nl": {
"headline": "Afleverpoging mislukt",
"description": "Afleverpoging mislukt op bestemming"
}
},
"courierName": "Peddler",
"reason": "Customer not answering; no neighbours available"
}
}

In case of statuses OUT_FOR_DELIVERY & DELIVERED the webhook body will also contain the location field with gps coordinates of the location where the status change took place.

An example of the same is as follows:

Webhook body
{
"id": "PlakFjJkuYatSCXFvDxTs",
"carrierTrackingNumber": "P123456789012345678",
"metaData": "SHIP_AMS_002",
"status": "OUT_FOR_DELIVERY",
"location": {
"lat": 52.3409992,
"lng": 4.8236365
},
"ts": "2023-06-14T10:54:55.896Z",
"trackingUrl": "https://t.pdlr.nl/P123456789012345678/",
"code": 410
}